package dp;

public class Application {

	public static void main(String[] args) throws InstantiationException,
			IllegalAccessException, ClassNotFoundException {

		// instanciation statique
		AbstractFactory factoryA = new FactoryImplA();
		AbstractPlugin pluginA = factoryA.getInstance();
		pluginA.traitement();

		// instanciation dynamique
		AbstractFactory factoryB = (AbstractFactory) Class.forName(
				"dp.FactoryImplB").newInstance();
		AbstractPlugin plugin = factoryB.getInstance();
		plugin.traitement();
	}
}
